# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
pkgname=openxr
pkgver=1.0.30
pkgrel=1
pkgdesc='An open standard for virtual reality and augmented reality platforms and devices'
arch=('loong64' 'x86_64')
url='https://www.khronos.org/openxr/'
depends=('jsoncpp' 'libx11' 'vulkan-icd-loader' 'libglvnd' 'libxrandr' 'libxxf86vm')
makedepends=('cmake' 'vulkan-headers' 'python' 'ninja' 'wayland' 'mesa')
license=('APACHE')
source=("https://github.com/KhronosGroup/OpenXR-SDK-Source/releases/download/release-${pkgver}/OpenXR-SDK-Source-release-${pkgver}.tar.gz"{,.asc})
validpgpkeys=(F029455EAB70F520FF4A03BD7F534CD56F00321E)
sha512sums=('41600c2706897abeb6c1fc7d5b3fb96160ef36162654ca16d05722e16053d06e9b7ee3ed58b61c9b36ae9a14c06ca53c8e7029c13157f876f8a14c46f62439c1'
            'SKIP')

build() {
  cd OpenXR-SDK-Source-release-${pkgver}

  cmake \
    -GNinja \
    -Bbuild \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_TESTS=ON \
    -DPRESENTATION_BACKEND=xlib \
    -DDYNAMIC_LOADER=ON
  ninja -C build
}

package() {
  cd OpenXR-SDK-Source-release-${pkgver}

  DESTDIR="$pkgdir" ninja -C build install
}
